package com.qijian.maindata.domain.vo;

import com.qijian.maindata.domain.ProductAttributeItem;
import com.qijian.maindata.domain.ProductAttributeItemDetail;
import lombok.Data;

import java.util.List;

@Data
public class ProductAttributeItemValVo extends ProductAttributeItem {
    private List<attrItem> vals;

    @Data
    public static class attrItem {
        String code;
        String val;
        boolean isSelect;
        boolean isDefault;

        public attrItem(ProductAttributeItemDetail productAttributeItemDetail) {
            this.code = productAttributeItemDetail.getNumber();
            this.val = productAttributeItemDetail.getName();
            this.isSelect = productAttributeItemDetail.getIsSelect();
            this.isDefault = productAttributeItemDetail.getIsDefault();
        }

        public attrItem(String code, String val, boolean isDefault) {
            this.code = code;
            this.val = val;
            this.isDefault = isDefault;
        }
    }
}
